package com.forum.core.dao.jdbc;

import javax.sql.DataSource;

import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
/**
 * @Company <Jinher Technology Development Company LTD.>
 * @Project jcs
 * @version <1.0>
 * @Author  <liuls>
 * @Date 2010-03-27 
 * @description  命名查询
 * 
 */
public class NameJdbcTemplateExtend extends NamedParameterJdbcTemplate{
	
	
	public DataSource dataSource;
	
	/**
	 * 初始构造器
	 * 
	 * @param dataSource
	 *            数据源
	 */
	public NameJdbcTemplateExtend(DataSource dataSource) {
		super(dataSource);
		// TODO Auto-generated constructor stub
	}

	

	
	
	
	
	

	
//	public List<Map> querySP(String sql,Object args[], int[]argTypes, int startRow, int rowsCount,Class calzz)
//	throws DataAccessException {
//		return querySP(sql,args, argTypes, startRow, rowsCount,  ParameterizedBeanPropertyRowMapper.newInstance(calzz));
//	}

	
	/**
	 * @param sql
	 * @param args
	 * @param argTypes
	 * @param startRow
	 * @param rowsCount
	 * @param rowMapper
	 * @return
	 * @throws DataAccessException
	 * @date 2010-03-27 18:07:09
	 * @author liuls
	 * @description  查询时添参数及参数类别
	 */
	@SuppressWarnings("unchecked")
//	public List<Map> querySP(String sql,Object args[], int[]argTypes, int startRow, int rowsCount,
//			RowMapper rowMapper) throws DataAccessException {
//		Map map=new HashMap();
//		//this.
//		//this.query(sql, paramMap, new SplitPageResultSetExtractor(rowMapper,
//		//		startRow, rowsCount));
//		//this.query(sql, paramMap, rse)
//		return (List) this.(sql, args,argTypes,new SplitPageResultSetExtractor(rowMapper,
//				startRow, rowsCount));
//	}

	public DataSource getDataSource() {
		return dataSource;
	}

	public void setDataSource(DataSource dataSource) {
		this.dataSource = dataSource;
		//super.setDataSource(dataSource);
	}
}
